import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import { WeaLocaleProvider, WeaSearchGroup, WeaFormItem, WeaSelect, WeaBrowser, WeaDatePicker, WeaHelpfulTip  } from "ecCom";
import { Row, Col } from "antd";
const getLabel = WeaLocaleProvider.getLabel;
export default class SelectOptions extends React.Component {


    constructor(props) {
        super(props);
        this.state = {
            createDate:""
        }
    }

    onChangeSelect = (type,value) =>{
        this.setState({[type]:value});
        const { onCallBack } = this.props;
        if(typeof onCallBack === "function"){
            onCallBack(type,value);
        }
    }


    render() {
        const { createDate } = this.state;
        return (
            <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@rgmqc2`} title={getLabel(384161, '更新条件')} showGroup={true} >
                {/* <WeaFormItem label={getLabel(882, '创建人')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaBrowser
                        // replaceDatas={toJS(detailData.principalid_arr)}
                        type={1}
                        textDecoration={true}
                        inputStyle={{ width: 200 }}
                        onChange={(ids, names, datas) =>
                            this.onChangeSelect("creater",ids)
                        }
                        viewAttr={2}
                        title={getLabel(16936, '责任人')}
                    />
                </WeaFormItem> */}
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@sas97l`} label={getLabel(27420,'导入日期')} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
                    <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@7yzgkd`}>
                         <WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@cis4y9`} style={{width:150}} viewAttr={3} value={createDate}  onChange={value => this.onChangeSelect("createDate",value)} />
                         <span style={{ display: "inline-block", width: 10 }}></span>
                         <WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@yiwvnt`} title={getLabel(521483,'进行更新操作时，需要选择将要更新数据的上次导入日期，防止数据更新有误')} placement="topLeft" />
                    </Row>
                  </WeaFormItem>

            </WeaSearchGroup>
        );
    }

}
